home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 3181 < prev    next >
Mailbox/MIME Entity  |  1996-08-06  |  2.3 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Newsgroup Content (archive/news) magic Supported
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
100% dexvert Internet Message Format (text/imf) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file news, ASCII text default
100% checkBytes Printable ASCII default
100% dexmagic PrintFox/Pagefox WEAK default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)
100% xdgMime message/news default



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 6e | 74 70 64 32 2e 63 78 6f |Path: nn|tpd2.cxo|
|00000010| 2e 64 65 63 2e 63 6f 6d | 21 75 73 65 6e 65 74 0a |.dec.com|!usenet.|
|00000020| 46 72 6f 6d 3a 20 42 72 | 69 61 6e 20 48 69 62 62 |From: Br|ian Hibb|
|00000030| 65 72 74 20 3c 62 5f 68 | 69 62 62 65 72 74 40 63 |ert <b_h|ibbert@c|
|00000040| 73 63 33 32 2e 65 6e 65 | 74 2e 64 65 63 2e 63 6f |sc32.ene|t.dec.co|
|00000050| 6d 3e 0a 4e 65 77 73 67 | 72 6f 75 70 73 3a 20 63 |m>.Newsg|roups: c|
|00000060| 6f 6d 70 2e 6c 61 6e 67 | 2e 63 2b 2b 0a 53 75 62 |omp.lang|.c++.Sub|
|00000070| 6a 65 63 74 3a 20 52 65 | 3a 20 43 2b 2b 20 73 79 |ject: Re|: C++ sy|
|00000080| 6e 74 61 78 0a 44 61 74 | 65 3a 20 32 32 20 4a 61 |ntax.Dat|e: 22 Ja|
|00000090| 6e 20 31 39 39 36 20 31 | 37 3a 34 32 3a 31 35 20 |n 1996 1|7:42:15 |
|000000a0| 47 4d 54 0a 4f 72 67 61 | 6e 69 7a 61 74 69 6f 6e |GMT.Orga|nization|
|000000b0| 3a 20 44 69 67 69 74 61 | 6c 20 45 71 75 69 70 6d |: Digita|l Equipm|
|000000c0| 65 6e 74 20 43 6f 72 70 | 6f 72 61 74 69 6f 6e 0a |ent Corp|oration.|
|000000d0| 4d 65 73 73 61 67 65 2d | 49 44 3a 20 3c 34 65 30 |Message-|ID: <4e0|
|000000e0| 69 39 6e 24 6b 39 6f 40 | 6e 6e 74 70 64 32 2e 63 |i9n$k9o@|nntpd2.c|
|000000f0| 78 6f 2e 64 65 63 2e 63 | 6f 6d 3e 0a 52 65 66 65 |xo.dec.c|om>.Refe|
|00000100| 72 65 6e 63 65 73 3a 20 | 3c 33 31 30 32 45 44 44 |rences: |<3102EDD|
|00000110| 41 2e 34 35 41 36 40 74 | 72 69 62 65 63 61 2e 69 |A.45A6@t|ribeca.i|
|00000120| 6f 73 2e 63 6f 6d 3e 0a | 4e 4e 54 50 2d 50 6f 73 |os.com>.|NNTP-Pos|
|00000130| 74 69 6e 67 2d 48 6f 73 | 74 3a 20 70 65 6f 31 30 |ting-Hos|t: peo10|
|00000140| 31 32 5f 70 6f 72 74 31 | 2e 70 65 6f 2e 64 65 63 |12_port1|.peo.dec|
|00000150| 2e 63 6f 6d 0a 4d 69 6d | 65 2d 56 65 72 73 69 6f |.com.Mim|e-Versio|
|00000160| 6e 3a 20 31 2e 30 0a 43 | 6f 6e 74 65 6e 74 2d 54 |n: 1.0.C|ontent-T|
|00000170| 79 70 65 3a 20 74 65 78 | 74 2f 70 6c 61 69 6e 3b |ype: tex|t/plain;|
|00000180| 20 63 68 61 72 73 65 74 | 3d 75 73 2d 61 73 63 69 | charset|=us-asci|
|00000190| 69 0a 43 6f 6e 74 65 6e | 74 2d 54 72 61 6e 73 66 |i.Conten|t-Transf|
|000001a0| 65 72 2d 45 6e 63 6f 64 | 69 6e 67 3a 20 37 62 69 |er-Encod|ing: 7bi|
|000001b0| 74 0a 58 2d 4d 61 69 6c | 65 72 3a 20 4d 6f 7a 69 |t.X-Mail|er: Mozi|
|000001c0| 6c 6c 61 20 31 2e 32 4e | 20 28 57 69 6e 64 6f 77 |lla 1.2N| (Window|
|000001d0| 73 3b 20 49 3b 20 31 36 | 62 69 74 29 0a 54 6f 3a |s; I; 16|bit).To:|
|000001e0| 20 6c 65 6f 6e 61 72 64 | 6a 40 74 72 69 62 65 63 | leonard|j@tribec|
|000001f0| 61 2e 69 6f 73 2e 63 6f | 6d 0a 0a 4a 6f 68 6e 20 |a.ios.co|m..John |
|00000200| 4c 65 6f 6e 61 72 64 20 | 3c 6c 65 6f 6e 61 72 64 |Leonard |<leonard|
|00000210| 6a 40 74 72 69 62 65 63 | 61 2e 69 6f 73 2e 63 6f |j@tribec|a.ios.co|
|00000220| 6d 3e 20 77 72 6f 74 65 | 3a 0a 3e 49 6e 20 74 68 |m> wrote|:.>In th|
|00000230| 65 20 62 6f 6f 6b 20 42 | 6f 72 6c 61 6e 64 20 43 |e book B|orland C|
|00000240| 2b 2b 20 34 2e 35 20 4f | 62 6a 65 63 74 2d 4f 72 |++ 4.5 O|bject-Or|
|00000250| 69 65 6e 74 65 64 20 50 | 72 6f 67 72 61 6d 6d 69 |iented P|rogrammi|
|00000260| 6e 67 20 62 79 20 54 65 | 64 20 46 61 69 73 6f 6e |ng by Te|d Faison|
|00000270| 2c 20 53 61 6d 27 73 20 | 50 75 62 6c 69 73 68 69 |, Sam's |Publishi|
|00000280| 6e 67 2c 20 70 61 67 65 | 20 0a 3e 36 30 33 2c 20 |ng, page| .>603, |
|00000290| 74 68 65 72 65 20 69 73 | 20 61 6e 20 65 78 61 6d |there is| an exam|
|000002a0| 70 6c 65 20 75 73 69 6e | 67 20 74 68 65 20 42 6f |ple usin|g the Bo|
|000002b0| 72 6c 61 6e 64 20 74 65 | 6d 70 6c 61 74 65 20 63 |rland te|mplate c|
|000002c0| 6c 61 73 73 20 6c 69 62 | 72 61 72 79 2e 20 46 69 |lass lib|rary. Fi|
|000002d0| 72 73 74 2c 20 74 68 65 | 20 69 64 65 61 20 69 73 |rst, the| idea is|
|000002e0| 20 74 6f 20 69 6e 73 74 | 61 6e 74 69 61 74 65 20 | to inst|antiate |
|000002f0| 0a 3e 61 20 63 6c 61 73 | 73 20 6f 66 20 74 79 70 |.>a clas|s of typ|
|00000300| 65 20 54 4c 69 73 74 49 | 6d 70 28 66 72 6f 6d 20 |e TListI|mp(from |
|00000310| 61 20 74 65 6d 70 6c 61 | 74 65 29 20 61 6e 64 20 |a templa|te) and |
|00000320| 74 68 65 6e 20 69 6e 73 | 74 61 6e 74 69 61 74 65 |then ins|tantiate|
|00000330| 20 61 6e 20 6f 62 6a 65 | 63 74 20 6f 66 20 74 68 | an obje|ct of th|
|00000340| 61 74 20 74 79 70 65 2e | 20 41 6e 64 20 74 68 65 |at type.| And the|
|00000350| 6e 20 74 6f 20 0a 3e 69 | 6e 73 74 61 6e 74 69 61 |n to .>i|nstantia|
|00000360| 74 65 20 61 20 63 6c 61 | 73 73 20 6f 66 20 74 79 |te a cla|ss of ty|
|00000370| 70 65 20 54 4c 69 73 74 | 49 74 65 72 61 74 6f 72 |pe TList|Iterator|
|00000380| 49 6d 70 20 66 72 6f 6d | 20 61 20 74 65 6d 70 6c |Imp from| a templ|
|00000390| 61 74 65 2c 20 61 6e 64 | 20 74 68 65 6e 20 74 6f |ate, and| then to|
|000003a0| 20 69 6e 73 74 61 6e 74 | 69 61 74 65 20 61 6e 20 | instant|iate an |
|000003b0| 6f 62 6a 65 63 74 20 6f | 66 20 0a 3e 74 68 61 74 |object o|f .>that|
|000003c0| 20 74 79 70 65 2e 20 54 | 68 65 20 54 4c 69 73 74 | type. T|he TList|
|000003d0| 49 74 65 72 61 74 6f 72 | 20 6f 62 6a 65 63 74 20 |Iterator| object |
|000003e0| 77 69 6c 6c 20 62 65 20 | 75 73 65 64 20 74 6f 20 |will be |used to |
|000003f0| 6d 6f 76 65 20 74 68 72 | 6f 75 67 68 20 74 68 65 |move thr|ough the|
|00000400| 20 54 4c 69 73 74 49 6d | 70 20 6f 62 6a 65 63 74 | TListIm|p object|
|00000410| 2e 20 54 68 65 20 64 65 | 74 61 69 6c 73 20 0a 3e |. The de|tails .>|
|00000420| 61 62 6f 75 74 20 74 68 | 65 73 65 20 63 6c 61 73 |about th|ese clas|
|00000430| 73 20 74 65 6d 70 6c 61 | 74 65 73 20 61 72 65 20 |s templa|tes are |
|00000440| 6e 6f 74 20 77 68 61 74 | 20 6d 79 20 71 75 65 73 |not what| my ques|
|00000450| 74 69 6f 6e 20 69 73 20 | 61 62 6f 75 74 2c 20 62 |tion is |about, b|
|00000460| 75 74 20 72 61 74 68 65 | 72 20 74 68 65 20 73 79 |ut rathe|r the sy|
|00000470| 6e 74 61 78 20 6f 66 20 | 6f 6e 65 20 6f 66 20 74 |ntax of |one of t|
|00000480| 68 65 20 0a 3e 6c 69 6e | 65 73 20 69 6e 20 74 68 |he .>lin|es in th|
|00000490| 65 20 70 72 6f 67 72 61 | 6d 20 69 73 3a 0a 3e 20 |e progra|m is:.> |
|000004a0| 20 20 20 20 54 4c 69 73 | 74 49 74 65 72 61 74 6f | TLis|tIterato|
|000004b0| 72 49 6d 70 3c 73 74 72 | 69 6e 67 3e 20 20 20 20 |rImp<str|ing> |
|000004c0| 20 6e 65 78 74 28 61 29 | 3b 20 20 2f 2f 20 77 68 | next(a)|; // wh|
|000004d0| 65 72 65 20 61 20 69 73 | 20 61 6e 20 6f 62 6a 65 |ere a is| an obje|
|000004e0| 63 74 20 6f 66 20 74 79 | 70 65 20 54 4c 69 73 74 |ct of ty|pe TList|
|000004f0| 49 6d 70 3c 73 74 72 69 | 6e 67 3e 0a 3e 20 20 20 |Imp<stri|ng>.> |
|00000500| 20 20 2e 2e 2e 0a 3e 20 | 20 20 20 20 77 68 69 6c | ....> | whil|
|00000510| 65 28 6e 65 78 74 29 20 | 20 20 20 20 2f 2f 20 3f |e(next) | // ?|
|00000520| 3f 0a 3e 20 20 20 20 20 | 2e 2e 2e 0a 3e 20 20 20 |?.> |....> |
|00000530| 20 20 57 68 61 74 20 64 | 6f 65 73 20 74 68 69 73 | What d|oes this|
|00000540| 20 6c 69 6e 65 20 6d 65 | 61 6e 3f 20 48 6f 77 20 | line me|an? How |
|00000550| 64 6f 65 73 20 69 74 20 | 77 6f 72 6b 3f 0a 3e 0a |does it |work?.>.|
|00000560| 3e 20 20 20 20 20 4a 6f | 68 6e 0a 0a 41 6e 20 49 |> Jo|hn..An I|
|00000570| 6e 74 65 72 61 74 6f 72 | 20 69 73 20 75 73 75 61 |nterator| is usua|
|00000580| 6c 6c 79 20 75 73 65 64 | 20 74 6f 20 73 74 65 70 |lly used| to step|
|00000590| 20 74 68 72 6f 75 67 68 | 20 61 20 6c 69 73 74 20 | through| a list |
|000005a0| 6f 66 20 6f 62 6a 65 63 | 74 73 20 6f 6e 65 20 6f |of objec|ts one o|
|000005b0| 62 6a 65 63 74 20 0a 61 | 74 20 61 20 74 69 6d 65 |bject .a|t a time|
|000005c0| 2e 20 20 54 68 65 20 6e | 65 78 74 28 29 20 69 6e |. The n|ext() in|
|000005d0| 74 65 72 61 74 6f 72 20 | 66 75 6e 63 74 69 6f 6e |terator |function|
|000005e0| 20 77 69 6c 6c 20 72 65 | 74 75 72 6e 20 74 68 65 | will re|turn the|
|000005f0| 20 6e 65 78 74 20 6f 62 | 6a 65 63 74 20 69 6e 20 | next ob|ject in |
|00000600| 0a 74 68 65 20 6c 69 73 | 74 20 6f 72 20 61 20 30 |.the lis|t or a 0|
|00000610| 20 69 66 20 69 74 20 68 | 61 73 20 72 65 61 63 68 | if it h|as reach|
|00000620| 65 64 20 74 68 65 20 65 | 6e 64 20 6f 66 20 74 68 |ed the e|nd of th|
|00000630| 65 20 6c 69 73 74 2e 0a | 0a 0a 54 68 65 20 22 77 |e list..|..The "w|
|00000640| 68 69 6c 65 28 65 78 70 | 72 29 20 73 74 61 74 65 |hile(exp|r) state|
|00000650| 6d 65 6e 74 3b 22 70 72 | 6f 67 72 61 6d 20 63 6f |ment;"pr|ogram co|
|00000660| 6e 74 72 75 63 74 20 77 | 69 6c 6c 20 65 78 65 63 |ntruct w|ill exec|
|00000670| 75 74 65 20 74 68 65 20 | 73 74 61 74 65 6d 65 6e |ute the |statemen|
|00000680| 74 20 0a 61 73 20 6c 6f | 6e 67 20 61 73 20 74 68 |t .as lo|ng as th|
|00000690| 65 20 61 73 20 74 68 65 | 20 65 78 70 72 65 73 73 |e as the| express|
|000006a0| 69 6f 6e 20 65 78 70 72 | 20 65 76 61 6c 75 61 74 |ion expr| evaluat|
|000006b0| 65 73 20 74 6f 20 61 20 | 6e 6f 6e 2d 7a 65 72 6f |es to a |non-zero|
|000006c0| 20 76 61 6c 75 65 2e 20 | 20 49 66 0a 74 68 65 20 | value. | If.the |
|000006d0| 65 78 70 72 20 65 76 65 | 72 20 65 76 61 6c 75 61 |expr eve|r evalua|
|000006e0| 74 65 73 20 74 6f 20 30 | 20 74 68 65 6e 20 73 74 |tes to 0| then st|
|000006f0| 61 74 65 6d 65 6e 74 20 | 77 69 6c 6c 20 6e 6f 74 |atement |will not|
|00000700| 20 62 65 20 65 78 65 63 | 75 74 65 64 20 61 6e 64 | be exec|uted and|
|00000710| 20 0a 70 72 6f 67 72 61 | 6d 20 66 6c 6f 77 20 77 | .progra|m flow w|
|00000720| 69 6c 6c 20 70 72 6f 63 | 65 64 65 20 74 6f 20 74 |ill proc|ede to t|
|00000730| 68 65 20 6e 65 78 74 20 | 73 74 61 74 65 6d 65 6e |he next |statemen|
|00000740| 74 2e 0a 0a 57 68 61 74 | 20 61 6c 6c 20 74 68 69 |t...What| all thi|
|00000750| 73 20 6d 65 61 6e 73 20 | 66 6f 72 20 74 68 65 20 |s means |for the |
|00000760| 70 61 72 74 69 63 75 6c | 61 72 20 70 72 6f 67 72 |particul|ar progr|
|00000770| 61 6d 20 69 73 3a 0a 22 | 52 65 70 65 61 74 20 74 |am is:."|Repeat t|
|00000780| 68 65 20 73 74 61 74 65 | 6d 65 6e 74 20 69 6e 20 |he state|ment in |
|00000790| 74 68 65 20 77 68 69 6c | 65 20 6c 6f 6f 70 20 66 |the whil|e loop f|
|000007a0| 6f 72 20 65 61 63 68 20 | 6f 62 6a 65 63 74 20 69 |or each |object i|
|000007b0| 6e 20 74 68 65 20 6c 69 | 73 74 20 75 6e 74 69 6c |n the li|st until|
|000007c0| 20 0a 74 68 65 72 65 20 | 61 72 65 20 6e 6f 20 6d | .there |are no m|
|000007d0| 6f 72 65 20 6f 62 6a 65 | 63 74 73 22 0a 0a 49 74 |ore obje|cts"..It|
|000007e0| 20 69 73 20 66 61 69 72 | 6c 79 20 63 6f 6d 6d 6f | is fair|ly commo|
|000007f0| 6e 20 74 6f 20 73 65 65 | 20 73 75 63 68 20 61 20 |n to see| such a |
|00000800| 77 68 69 6c 65 20 6c 6f | 6f 70 20 69 6e 20 61 20 |while lo|op in a |
|00000810| 70 72 6f 67 72 61 6d 2c | 20 6e 6f 74 20 6f 6e 6c |program,| not onl|
|00000820| 79 20 77 69 74 68 20 0a | 69 74 65 72 61 74 6f 72 |y with .|iterator|
|00000830| 73 2c 20 62 75 74 20 77 | 69 74 68 20 6f 74 68 65 |s, but w|ith othe|
|00000840| 72 20 6f 70 65 72 61 74 | 69 6f 6e 73 20 61 73 20 |r operat|ions as |
|00000850| 77 65 6c 6c 2e 0a 0a 0a | 2d 2d 20 0a 2a 2a 2a 2a |well....|-- .****|
|00000860| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000870| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 2a 2a 2a 2a 2a |********|********|
|00000880| 2a 2a 2a 2a 2a 2a 2a 2a | 2a 2a 2a 0a 42 72 69 61 |********|***.Bria|
|00000890| 6e 20 48 69 62 62 65 72 | 74 20 20 62 5f 68 69 62 |n Hibber|t b_hib|
|000008a0| 62 65 72 74 40 63 73 63 | 33 32 2e 65 6e 65 74 2e |bert@csc|32.enet.|
|000008b0| 64 65 63 2e 63 6f 6d 0a | 44 69 67 69 74 61 6c 20 |dec.com.|Digital |
|000008c0| 45 71 75 69 70 6d 65 6e | 74 20 43 6f 72 70 6f 72 |Equipmen|t Corpor|
|000008d0| 61 74 69 6f 6e 0a 41 6c | 6c 20 6f 70 69 6e 69 6f |ation.Al|l opinio|
|000008e0| 6e 73 20 65 78 70 72 65 | 73 73 65 64 20 61 72 65 |ns expre|ssed are|
|000008f0| 20 6d 79 20 6f 77 6e 20 | 61 6e 64 20 73 68 6f 75 | my own |and shou|
|00000900| 6c 64 0a 6e 6f 74 20 62 | 65 20 61 73 73 75 6d 65 |ld.not b|e assume|
|00000910| 64 20 74 6f 20 62 65 20 | 74 68 65 20 6f 70 69 6e |d to be |the opin|
|00000920| 69 6f 6e 20 6f 66 20 6d | 79 20 65 6d 70 6c 6f 79 |ion of m|y employ|
|00000930| 65 72 0a 0a 0a | |er... | |
+--------+-------------------------+-------------------------+--------+--------+